package com.example.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class IndexController {

    @RequestMapping("/index")
    public String index() {

        return "success";
    }

    @RequestMapping("/json")
    public List json() {

        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            Map row = new HashMap();
            row.put("id", i);
            row.put("name", "name" + i);
            row.put("address", "address" + i);
            list.add(row);
        }
        return list;
    }

}

